package com.example.hanfu.collect;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

import androidx.annotation.Nullable;

public class CollectDBHelper extends SQLiteOpenHelper {
    private static final int VERSION = 1;
    private static final String DB_NAME = "history1.db";
    private static final String TAG = "CollectDBHelper";
    public static final String TB_NAME1 = "collect";
    public static final String TB_NAME2 = "history";
    public CollectDBHelper(@Nullable Context context) {
        super(context, DB_NAME, null, VERSION);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE "+TB_NAME1+" (username TEXT,title TEXT,href TEXT,img TEXT,content TEXT)");
        db.execSQL("CREATE TABLE "+TB_NAME2+" (username TEXT,title TEXT,href TEXT,img TEXT,content TEXT)");
        Log.i(TAG,"创建数据库");

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
